package pl.kamsoft.xml.ws.broker;

public class ServiceBrokerProxy implements pl.kamsoft.xml.ws.broker.ServiceBroker_PortType {
  private String _endpoint = null;
  private pl.kamsoft.xml.ws.broker.ServiceBroker_PortType serviceBroker_PortType = null;
  
  public ServiceBrokerProxy() {
    _initServiceBrokerProxy();
  }
  
  public ServiceBrokerProxy(String endpoint) {
    _endpoint = endpoint;
    _initServiceBrokerProxy();
  }
  
  private void _initServiceBrokerProxy() {
    try {
      serviceBroker_PortType = (new pl.kamsoft.xml.ws.broker.ServiceBroker_ServiceLocator()).getServiceBroker();
      if (serviceBroker_PortType != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)serviceBroker_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)serviceBroker_PortType)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (serviceBroker_PortType != null)
      ((javax.xml.rpc.Stub)serviceBroker_PortType)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public pl.kamsoft.xml.ws.broker.ServiceBroker_PortType getServiceBroker_PortType() {
    if (serviceBroker_PortType == null)
      _initServiceBrokerProxy();
    return serviceBroker_PortType;
  }
  
  public pl.kamsoft.xml.ws.broker.ServiceResponse executeService(pl.kamsoft.xml.ws.broker.ServiceRequest request, pl.kamsoft.xml.ws.common.AuthToken token, pl.kamsoft.xml.ws.common.Session session) throws java.rmi.RemoteException, pl.kamsoft.xml.ws.common.ServiceException, pl.kamsoft.xml.ws.common.SessionException, pl.kamsoft.xml.ws.common.InputException, pl.kamsoft.xml.ws.common.AuthTokenException, pl.kamsoft.xml.ws.common.AuthenticationException, pl.kamsoft.xml.ws.common.ServerException, pl.kamsoft.xml.ws.common.AuthorizationException{
    if (serviceBroker_PortType == null)
      _initServiceBrokerProxy();
    return serviceBroker_PortType.executeService(request, token, session);
  }
  
  
}